<%@page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@include file="/jsp/comm_css_include.jsp"%>
<!doctype html>
<html>
<head>
</head>
<body class="gray-bg">
	<div class="container creditbody">
		<div class="iboxtitle">
			<span><i class="glyphicon glyphicon-map-marker"></i>&nbsp;业务受理>基本资料登记>客户资料补登记</span>
			<a href="javascript:void(0)"></a>
		</div>
		<div class="ibox-content ibox-con">
				<%@include file="/web/system/yw/yw_include.jsp"%>
		</div>
		
		<div class="tab-bg">
			<div class="tab-width">
			   <div class="row m-b-lg">
		            <div class="col-sm-12">
		                <div class="tabs-container-list">
		                    <div class="tabs-left">
		                        <ul class="nav nav-tabs">
		                            <li class="active"><a data-toggle="tab" href="#tab-7"  id="left_tab_1">审批流转</a></li>
		                            <li class=""><a data-toggle="tab" href="#tab-12" onclick="attachment_files();">附件归档</a></li>
		                        </ul>
		                        
		                         <div class="tab-content">
		                            <div id="tab-7" class="tab-pane active">
										<div class="panel-body" style="border-bottom: none">
										 	<div id="outersp" class="outer">
											    <ul id="tabsp" class="taber">
											        <li class="current"  id="right_tabl_1">审批流转</li>
											    </ul>
											    <div id="contentsp" class="contenter">
											        <ul class="ul-style" style="display:block;">
											            <%@include file="/web/system/kehubiao/splzYw.jsp"%>	
											    	</ul>
											    </div>	    
		                        			</div>
		                        		</div>
		                        	</div>
		                            <div id="tab-12" class="tab-pane">
		                               <div class="panel-body">
		                                	   <!-- 附件信息 -->
		                                		<%@include file="/web/system/yw/fujian_include.jsp"%>
		                                </div>
		                            </div>
		                        </div>
		                    </div>
		                </div>
		            </div>
		         </div>
		      </div>
		</div>
		
		<!-- public quote -->
		<%@include file="/jsp/comm_js_include.jsp"%>
		<!-- 文件上传 -->
		<%@include file="/jsp/common_fileupload_multi_include.jsp"%>
		<%@include file="/web/system/yw/fujian_js_include.jsp"%>
	    <script type="text/javascript" src="${basePath }/js/yw/ywSupplementBussinessDetail.js?v=${empty cssVersion ? Math.random() : cssVersion }" charset="utf-8"></script>
		<!-- jqGrid -->
	    <script type="text/javascript" charset="utf-8" src="${basePath}/js/plugins/jqgriddemo/js/jquery.jqGrid.min.js"></script>
	    <script type="text/javascript" charset="utf-8" src="${basePath}/js/plugins/jqgriddemo/js/grid.locale-cn.min.js"></script>	
		<script type="text/javascript" src="${basePath}/js/kehubiao/customer.js?v=${empty cssVersion ? Math.random() : cssVersion }" charset="utf-8"></script>
 		<!-- layerDate plugin javascript -->
		<!-- 
 	    作者：程立勇
 	   描述：js脚本
 	 -->
		<script type="text/javascript">
		var busiId;
		
		var queryCreditApplyId;
		
	 	$(document).ready(function () {
	        //放事件后，可能需要解绑事件
	        getData('${basePath}/YwSupplementBussinessController/ywSupplementBussinessDetail',function(){
	        	busiId = $('#busiId').val();
	        	getYwBusinessDetail();
	        });
	    });
	 	
	 	function attachment_files(){
	 		showFujian();
	 	}
	 	
	 	/* 业务信息 */ 
	 	  function getYwBusinessDetail(fn){
	 		 getYwBusinessDetailZ('${basePath}/BaseCustomerController/ywBusinessDetail', fn); 
	 	  }
	 	/* 流转卡 */
		function showSplz(phoneStatus, busiStatus,channelType, channelStatus, lessInformationStatus,addedStatus1, pickCarStatus, registrationPlatesStatus, pledgeStatus, lendingStatus, depositMoneyStatus,carType,lastBusiStatus) {
	 		 if(phoneStatus == '${phoneStatusNames.PHONE_1_ING}') {
	 			green('dsys');
	 			space('dses');
	 		 } else if(phoneStatus == '${phoneStatusNames.PHONE_2_ING}') {
	 			 grey('dsys');
	 			 green('dses');
	 		 } else if(phoneStatus == '${phoneStatusNames.PHONE_2_SUCCESS}'){
	 			 grey('dsys');
	 			 grey('dses');
	 		 } else if(phoneStatus == '${phoneStatusNames.PHONE_1_FAIL}'){
	 			 grey('dsys');
	 			 space('dses');
	 		 } else if(phoneStatus == '${phoneStatusNames.PHONE_2_FAIL}'){
	 			 grey('dsys');
	 			 grey('dses'); 
	 		 } else {
	 			 space('dsys');
	 			 space('dses');
	 		 }
	 		 
	 		 if(pickCarStatus == 0) {
	 			space('tcqr');
	 		 } else if(pickCarStatus == 1) {
	 			green('tcqr');
	 		 } else if(pickCarStatus == 2) {
	 			grey('tcqr');  
	 		 } else if(pickCarStatus == 3) { //二手车
	 			space('tcqr');  
	 		 }
	 		 //车辆资料复审
	 		 if(carType == '02') {
	 			 if(busiStatus == 210) {
	 				green('clzlfs');
	 			 } else if(busiStatus < 210) {
	 				space('clzlfs');
	 			 } else if(busiStatus >= 9000){
	 				if(lastBusiStatus <= 210) {
	 					space('clzlfs');
		 			 } else {
		 				grey('clzlfs');
		 			 }
	 			 } else {
	 				grey('clzlfs'); 
	 			 }
	 		 } else if(carType == '01') {
	 			if(busiStatus == 400) {
	 				green('clzlfs');
	 			 } else if(busiStatus < 400) {
	 				space('clzlfs');
	 			 } else if(busiStatus >= 9000) {
	 				if(lastBusiStatus <= 400) {
	 					space('clzlfs');
		 			 } else {
		 				grey('clzlfs');
		 			 }
	 			 } else {
	 				grey('clzlfs'); 
	 			 }
	 		 }
	 		 if(pickCarStatus == 0) {
	 			space('tcqr');
	 		 } else if(pickCarStatus == 1) {
	 			green('tcqr');
	 		 } else if(pickCarStatus == 2) {
	 			grey('tcqr');  
	 		 } else if(pickCarStatus == 3) { //二手车
	 			space('tcqr');  
	 		 }
	 		 
	 		 if(registrationPlatesStatus == 0) {
	 			space('cpdj');
	 		 } else if(registrationPlatesStatus == 1) {
	 			green('cpdj');
	 		 } else if(registrationPlatesStatus == 2) {
	 			grey('cpdj');  
	 		 }
	 		 
	 		 if(pledgeStatus == 0) {
	 			space('dyqr');
	 		 } else if(pledgeStatus == 1) {
	 			green('dyqr');
	 		 } else if(pledgeStatus == 2) {
	 			grey('dyqr');  
	 		 }
	 		 
	 		 if(lendingStatus == 0) {
	 			space('aqhk');
	 		 } else if(lendingStatus == 1) {
	 			green('aqhk');
	 		 }
	 		 
	 		 if(depositMoneyStatus == 0) {
	 			space('tyjcs');
	 			space('tyjxb');
	 		 } else if(depositMoneyStatus == 1) {
	 			green('tyjcs');
	 			green('tyjxb');
	 		 } else if(depositMoneyStatus == 2) {
	 			grey('tyjcs');
	 			green('tyjxb');
	 		 } else if(depositMoneyStatus == 3) {
	 			green('tyjcs');
	 			grey('tyjxb');
	 		 } else if(depositMoneyStatus == 4) {
	 			grey('tyjcs');
	 			grey('tyjxb');
	 		 }
	 		 
	 		 if(!lessInformationStatus || lessInformationStatus == '') {
	 			space('zlbqbs');
	 		 } else if(lessInformationStatus == '${lessInformationStatusNames.QIAN_ZI_LIAO}'){
	 			green('zlbqbs');
	 		 } else if(lessInformationStatus == '${lessInformationStatusNames.ZI_LIAO_QI_QUAN}'){
	 			space('zlbqbs');
	 		 } else if(lessInformationStatus == '${lessInformationStatusNames.ZI_LIAO_YI_BU_QI}'){
	 			grey('zlbqbs');
	 		 }
	 		 if(lastBusiStatus == 9070) {
	 			grey('zlbqbs');
	 		 }
	 		 
	 		 if(!channelType || channelType == '') {
	 			space('lstdbs');
	 		 } else if (channelType == '50') {
	 			 if(!channelStatus || channelStatus == '') {
	 				space('lstdbs');
	 			 } else if(channelStatus == '10') {
	 				green('lstdbs');
	 			 } else if(channelStatus == '20') {
	 				grey('lstdbs');
	 			 } else if(channelStatus == '90') {
	 				grey('lstdbs');
	 			 }
	 		 } else {
	 			space('lstdbs');
	 		 }
	 		 $('.splztab').each(function(){
	 			var id =$(this).attr('id');
	 			
	 			var cw = $(this).attr('cw');
	 			if(cw && cw != '') {
	 				if(cw < addedStatus1) {
	 					grey(id);
	 				} else if(cw == addedStatus1) {
	 					green(id);
	 				} else {
	 					space(id);
	 				}
	 			 }
	 			
	 			var equal = $(this).attr('equal');
	 			var second = $(this).attr('second');
	 			var min = $(this).attr('min');
	 			var max = $(this).attr('max');
	 			
	 			equalLz(busiStatus, lastBusiStatus, id, equal, second, min, max);
	 			 
	 			if(carType == '01') { //新车时，二手车过户审核重置为空
	 				space('escbs');
	 			}
	 		 });
	 		 
	 		if(addedStatus1) {
	 			if(addedStatus1 <= 20) {
		 			space('sqdz'); 
		 		 } else if(addedStatus1 >= 100){
		 			if(addedStatus1 == 400) {
		 				green('sqdz');
			 			space('cwyshz');
			 			space('cweshz');
			 			space('cwfk');
		 			} else {
		 				grey('sqdz'); 
		 			}
		 		 }
	 		 } else {
	 			space('sqdz');  
	 		 }
	 	}
	 	
		//业务信息
		function getYwBusinessDetailZ(url,fn){
			$.dpAjax({
		 		url:url,
				data:{busiId:busiId},
				success: function(datas){
	 			  var data = datas.result;
		 				 if(data){
	 					 //提车状态
	 					 var pickCarStatus = data.pickCarStatus;
	 					 //车牌登记状态
	 					 var registrationPlatesStatus = data.registrationPlatesStatus;
	 					 //抵押状态
	 					 var pledgeStatus = data.pledgeStatus;
	 					 //按期还款状态
	 					 var lendingStatus = data.lendingStatus;
	 					 //退押金状态
	 					 var depositMoneyStatus = data.depositMoneyStatus;
	 					 //（弃贷后）最后状态
	 					 var lastBusiStatus = data.lastBusiStatus;
	 					 /* 业务信息 */
	     				 var ywBusinessDetail = data.ywBusinessDetail;
	     				 if(ywBusinessDetail) {
		     				 var phoneStatus = ywBusinessDetail.phoneStatus;
		     				 var busiStatus = ywBusinessDetail.busiStatus;
		     				 var channelType = ywBusinessDetail.channelType;
		     				 var channelStatus = ywBusinessDetail.channelStatus;
		     				 var lessInformationStatus = ywBusinessDetail.lessInformationStatus;
		     				 var addedStatus1 = ywBusinessDetail.addedStatus1;
		     				 var carType = ywBusinessDetail.carType;
		     				 showSplz(phoneStatus, busiStatus, channelType, channelStatus, lessInformationStatus, addedStatus1, pickCarStatus, registrationPlatesStatus, pledgeStatus, lendingStatus, depositMoneyStatus,carType,lastBusiStatus);
		     				
		     				if(fn){
		     					fn();
		     				}
	     				 }
		     				
		 			 }
		         }
		 	});
		}
		
		function equalLz(busiStatus, lastBusiStatus, id, equal, second, min, max){
	 		if(equal && equal != '' && equal >= 9810 && lastBusiStatus) { //弃贷，退贷等
	 			if(equal == busiStatus) {
					grey(id);
				} else {
					space(id);
				}
	 		} else if(equal && equal != ''){
	 			if(second && second != '' && lastBusiStatus > 9000 ) { //审核不通过等结束了的订单
	 				if(second <= lastBusiStatus) {
						grey(id);
					} else {
						space(id);
					}
	 			} else {  //还没有结束的订单
			 		if(equal < busiStatus) {
						grey(id);
					} else if(equal == busiStatus) {
						green(id);
					} else {
						space(id);
					}
	 			}
	 		}
 		
	 		if(min && min != '' && max && max != '' && max <= 9810 && lastBusiStatus) {
					 if(lastBusiStatus < min) {
					    space(id);
					 } else if(lastBusiStatus >= min && lastBusiStatus <= max){
						if(lastBusiStatus > 9000) {
							grey(id);
						} else {
							green(id);
						}
					 } else {
						grey(id);
					 }
	 		} else {
	 			if(busiStatus < min) {
					    space(id);
					 } else if(busiStatus >= min){
						grey(id);
					 }
	 		}
 		}
	 	
		function red(id){
			 $('#'+id).removeClass('bg-grey');
			 $('#'+id).removeClass('bg-green');
			 $('#'+id).addClass('bg-red');
		}
		function green(id) {
			 $('#'+id).removeClass('bg-red');
			 $('#'+id).removeClass('bg-grey');
			 $('#'+id).addClass('bg-green');
		}
		function grey(id) {
			 $('#'+id).removeClass('bg-red');
			 $('#'+id).removeClass('bg-green');
			 $('#'+id).addClass('bg-grey');
		}
		function space(id) {
			 $('#'+id).removeClass('bg-red');
			 $('#'+id).removeClass('bg-green');
			 $('#'+id).removeClass('bg-grey');
		}
</script>
</body>
</html>
